#ifndef XMAKEDOC_H
#define XMAKEDOC_H

#include "wiki.h"



class XMakeDoc : public Wiki
{
public:
    XMakeDoc();

    // Wiki interface
public:
    QString name() override;
    QString prefix() override;

    WIKI_AUTOLOAD
    WIKI_USE_LIST
    QList<QListWidgetItem *> searching_item(const QString &text) override;

    WIKI_NO_CONTENT
    void content_item(const QListWidgetItem *item, QWebEngineView *view) override;

    bool interactive(const QString &text) override;
    bool interactive_running() override;
    void interactive_restore() override;

private:
    QList<QString> m_categories;
    QMap<QString, QString> m_category_links;
    void add_category(const QString &category, const QString &link);

    QString m_category;
    QString m_category_link;
    QMap<QString, QList<QVariantMap>> m_xmake_docs;
    QList<QVariantMap> xmake_docs(const QString &link);

    bool m_reloading;
};

#endif // XMAKEDOC_H
